<template>
  <div>
    <el-row>
      <el-col>
        <div id="main" style="width:600px; height:400px;"></div>
      </el-col>
    </el-row>
    <el-row class="el-row">
    <el-col :span="5" v-for="o in 10" :key="o" :offset="0" style="margin:20px">
      <el-card :body-style="{ padding: '0px' }">
        <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
        <div style="padding: 14px;">
          <span>好吃的汉堡</span>
          <div class="bottom clearfix">
            <span class="time">￥16.9元</span>
            <div class="gwc"> 
              <el-button type="primary" size="medium" icon="el-icon-goods">购物车</el-button>
              <el-button type="danger" size="medium" >购买</el-button>
            </div>
          </div>
        </div>
      </el-card>
    </el-col>
  </el-row>
  </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
  mounted(){
        this.init()
    },
    methods:{
        init(){
            var myChart = echarts.init(document.getElementById('main'));
            myChart.setOption({
              title: {
              text: '商品分类',
              left: 'center'
            },
            tooltip: {
              trigger: 'item'
            },
            legend: {
              orient: 'vertical',
              left: 'left'
            },
            series: [
              {
                name: '商品分类',
                type: 'pie',
                radius: '50%',
                data: [
                  { value: 1048, name: '零食' },
                  { value: 735, name: '服饰' },
                  { value: 580, name: '电子' },
                  { value: 484, name: '美妆' },
                  { value: 300, name: '居家' }
                ],
                emphasis: {
                  itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }
            ]
            });
        }
    }

}
</script>

<style>
.gwc{
  margin-top: 20px;
}

.el-row{
  margin: 0 auto;
}
.time {
    font-size: 20px;
    color: #ff0000;
  }
  
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  
  .clearfix:after {
      clear: both
  }
</style>